const rl = require("readline").createInterface({ input: process.stdin });
var iter = rl[Symbol.asyncIterator]();
const readline = async () => (await iter.next()).value;

void (async function () {
    // Write your code here
    line = await readline();
    let nums = line.split(" ").map((e) => Number(e));
    let res = judgePoint24(nums);
    console.log(res);
})();

function judgePoint24(nums) {
    let n = nums.length;
    if (n === 1) {
        console.log(nums[0])
        if (Math.abs(nums[0] - 24) < 0.000000000001) {
            return true;
        }
        return false;
    }

    let result = false;
    for (let i = 0; i < n; i++) {
        for (let j = i + 1; j < n; j++) {
            let n1 = nums[i],
                n2 = nums[j],
                newNum = [];
            for (let m = 0; m < n; m++) {
                if (m !== i && m !== j) {
                    newNum.push(nums[m]);
                }
            }

            result = result || judgePoint24([...newNum, n1 + n2]);
            result = result || judgePoint24([...newNum, n1 - n2]);
            result = result || judgePoint24([...newNum, n2 - n1]);
            result = result || judgePoint24([...newNum, n1 * n2]);
            if (n1 !== 0) {
                result = result || judgePoint24([...newNum, n2 / n1]);
            }
            if (n2 !== 0) {
                result = result || judgePoint24([...newNum, n1 / n2]);
            }
            if(result){
                return true
            }
        }
    }
    return false
}
